---
layout: m1x_soap
title: Catalog Product Link
---

<h2><a name="MAPI-ProductLinks-Module%3AMageCatalog"></a>Module: Mage_Catalog</h2>

<p>The Mage_Catalog module allows you to manage categories and products.</p>

<h4><a name="MAPI-ProductLinks-ProductLinks"></a>Product Links</h4>

<p>Allows you to manage links for products, including related, cross-sells, up-sells, and grouped.</p>

<p><b>Resource Name</b>: catalog_product_link</p>

<p><b>Aliases</b>:</p>
<ul>
	<li>product_link</li>
</ul>


<p><b>Methods</b>:</p>
<ul>
	<li><a href="catalog_product_link.list.html" title="catalog_product_link.list">catalog_product_link.list</a> &#45; Retrieve products linked to the specified product</li>
	<li><a href="catalog_product_link.assign.html" title="catalog_product_link.assign">catalog_product_link.assign</a> &#45; Link a product to another product</li>
	<li><a href="catalog_product_link.update.html" title="catalog_product_link.update">catalog_product_link.update</a> &#45; Update a product link</li>
	<li><a href="catalog_product_link.remove.html" title="catalog_product_link.remove">catalog_product_link.remove</a> &#45; Remove a product link</li>
	<li><a href="catalog_product_link.types.html" title="catalog_product_link.types">catalog_product_link.types</a> &#45; Retrieve product link types</li>
	<li><a href="catalog_product_link.attributes.html" title="catalog_product_link.attributes">catalog_product_link.attributes</a> &#45; Retrieve product link type attributes</li>
</ul>


<h4><a name="MAPI-ProductLinks-Faults"></a>Faults</h4>


<table><tbody>
<tr>
<th> Fault Code </th>
<th> Fault Message </th>
</tr>
<tr>
<td> 100 </td>
<td> Given invalid link type. </td>
</tr>
<tr>
<td> 101 </td>
<td> Product not exists. </td>
</tr>
<tr>
<td> 102 </td>
<td> Invalid data given. Details in error message. </td>
</tr>
<tr>
<td> 104 </td>
<td> Product link not removed. </td>
</tr>
</tbody></table>


<h4><a name="MAPI-ProductLinks-Examples"></a>Examples</h4>

<h5><a name="MAPI-ProductLinks-Example1.Workingwithproductlinks"></a>Example 1. Working with product links</h5>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div id="root">
		<pre class="theme: Default; brush: java; gutter: false">$proxy = new SoapClient('http://magentohost/api/soap/?wsdl');
$sessionId = $proxy-&gt;login('apiUser', 'apiKey');

// Get list of related products
var_dump($proxy-&gt;call($sessionId, 'product_link.list', array('related', 'Sku')));

// Assign related product
$proxy-&gt;call($sessionId, 'product_link.assign', array('related', 'Sku', 'Sku2', array('position'=&gt;0, 'qty'=&gt;56)));

var_dump($proxy-&gt;call($sessionId, 'product_link.list', array('related', 'Sku')));

// Update related product
$proxy-&gt;call($sessionId, 'product_link.update', array('related', 'Sku', 'Sku2', array('position'=&gt;2)));

var_dump($proxy-&gt;call($sessionId, 'product_link.list', array('related', 'Sku')));

// Remove related product
$proxy-&gt;call($sessionId, 'product_link.remove', array('related', 'Sku', 'Sku2'));

var_dump($proxy-&gt;call($sessionId, 'product_link.list', array('related', 'Sku')));</pre>
		</div>
</div></div>

				    
Create the Magento文件系统所有者                   			    
